<?php 
/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License (AFL 3.0)
 * that is bundled with this package in the file LICENSE_AFL.txt.
 * It is also available through the world-wide-web at this URL:
 * http:opensource.org/licenses/afl-3.0.php 
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magentocommerce.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http:www.magentocommerce.com for more information.
 *
 * @category    design
 * @package     base_default
 * @copyright   Copyright (c) 2012 Magento Inc. (http:www.magentocommerce.com)
 * @license     http:opensource.org/licenses/afl-3.0.php   Academic Free License (AFL 3.0)
 */
 $_helper = $this->helper('catalog/output');
 
?>
<?php // var_dump('adsa');?>
<?php $_order_id = $this->getRequest()->getPost() ; ?>
<?php $_order = Mage::getModel('sales/order')->load($_order_id['order_id']) ?>
<?php //var_dump($_order['total_item_count']);  ?>

<div class="receipt" style="width:207px; padding: 10px; border: 1px solid; font-size: 10px;min-height:100%; margin: 0 auto;">
    <div class="logo" style="text-align: center;">
        <img src="<?php  echo $this->getSkinUrl('images/logo.gif') ?>" alt="<?php  echo $this->getLogoAlt() ?>" />
    </div>
    <div class="store-info" style="text-align: center; overflow: hidden;clear:both">
        <table width="100%" align="center" style="text-align: center;">
            <tbody><tr>
                <td style="text-align: center;">
                    Maple Tree House
                </td>
            </tr>
             <tr>
                <td style="text-align: center;">
                     Maple Tree House
                </td>
            </tr>
             <tr>
                <td style="text-align: center;">
                   Address
                </td>
            </tr>
             <tr>
                <td style="text-align: center;">
                  Phone
                </td>
            </tr>
             <tr>
                <td style="text-align: center;">
                    Email
                </td>
            </tr>
             <tr>
                <td style="text-align: center;">
                    <?php  echo $this->getUrl('')?>
                </td>
            </tr>
        </tbody></table>        
    </div>
    <div class="title" style="overflow: hidden; margin-bottom: 10px;">
        <table width="100%">
            <tbody><tr>
                <td align="center" style="text-transform: uppercase; font-weight: bold; text-align: center; vertical-align: middle; height: 35px; font-size: 16px;">
                    Retail Receipt
                </td>
            </tr>
            <tr>
                <td>
                    Avaiable in day
                </td>
            </tr>
        </tbody></table>        
    </div>
    <div class="content" style="">
        <div class="staff-info" style="border-bottom: 1px dashed; ">
            <table width="100%">
                <tbody><tr>
                    <td align="left" style="text-align: left;">
                        NO: <?php  echo $_order['created_at']?>
                    </td>
                    <td align="center" style="text-align: center;">
                        DATE: <?php  echo $_order['created_at']?>
                    </td>                    
                </tr>              
            </tbody></table>
            <table width="100%">               
                <tbody><tr>                   
                    <td align="right" style="text-align: right;">
                        Receipt: <?php  echo $_order['increment_id']?>
                    </td>
                </tr>
            </tbody></table>
        </div>
        <div class="order-info" style="border-bottom: 1px dashed; ">
            <table width="100%">
				<tbody>
				<?php  $_items = $_order->getItemsCollection(); ?>
				<?php  $_count = $_items->count(); ?>
				<?php  foreach ($_items as $_item): ?>
					<?php  $product = Mage::getModel('catalog/product')->load($_item->getId());?>
					<tr>
						<td colspan="2">
							<?php // echo $product->getAttributeText('barcode');?>							
						</td>
						<td colspan="2" align="right" style="text-align: right;">
							<?php  echo $_item->getName();?>
						</td>
					</tr>
					<tr>						
						 <td>
							<?php  echo (int)$_item->getQtyOrdered();?>
						</td>
						 <td>
							<?php  echo $_item->getPrice();?>
						</td>
						 <td align="right" style="text-align: right;">
							<?php  echo $_item->getPrice()*$_item->getQtyOrdered();?>
						</td>
					</tr>     
				<?php  endforeach; ?>        
				</tbody>
			</table>
        </div>
        <div class="order-total">
            <table width="100%">               
                <tbody><tr>
                    <td align="right" style="text-align: right;">
                        Total amount
                    </td>
                    <td>:</td>
                    <td align="right" style="text-align: right;">
                        <?php  echo $_order['grand_total']?>
                    </td>
                </tr>
                <tr>
                    <td align="right" style="text-align: right;">
                        Qty
                    </td>
                    <td>:</td>
                    <td align="right" style="text-align: right;">
                       <?php  echo $_order['total_item_count']?>
                    </td>
                </tr>
            </tbody></table>
        </div>
        <div class="payment-method" style="margin-top: 10px;">
            <table width="100%">
                <tbody>
					<tr>
						<td>Payment Method:</td>
						<td><?php // echo $_order->getPayment()->getMethodInstance()->getTitle()?></td>
					</tr>										
				</tbody>
			</table>                           
            <table width="100%">
                <tbody>
				<tr>
                	<td>Scanner no :</td>                    
                	<td><?php  echo $_order_id['admin']?></td>
                </tr>				
            </tbody></table>
        </div>
        <div class="customer-info" style="margin-top: 5px;">
            <span style="text-transform: uppercase; text-decoration: underline;">Customer infomation</span>
            <table>
                <tbody><tr>
                	<td>Code</td>
                    <td>:</td>
                	<td><?php  echo $_order['customer_id']?></td>
                </tr>
                <tr>
                	<td>Name</td>
                    <td>:</td>
                	<td><?php  echo $_order['customer_lastname']?></td>
              </tr>
            </tbody></table>
        </div>
        <div style="margin: 0 auto; width: 50%; border-top: 1px dashed; text-align: center; margin-top: 10px;">
            <table width="100%">
                <tbody><tr>
                    <td style="text-align: center;">
                        Thank you!
                    </td>
                </tr>
                <tr>
                    <td style="text-align: center;">
                        See you again!
                    </td>
                </tr>
            </tbody></table>
        </div>
    </div>
</div>

<script type="text/javascript">decorateTable('my-orders-table', {'tbody' : ['odd', 'even'], 'tbody tr' : ['first', 'last']})</script>
<script type="text/javascript">window.print();</script>
